class CreateCoupons < ActiveRecord::Migration[5.0]
  def change
    create_table :coupons do |t|
      t.integer :user_id
      t.string :name
      t.string :code
      t.string :purpose
      t.string :begin_date
      t.string :end_date
      t.boolean :receive, default: false
      t.string :region
      t.boolean :state, default: false
      t.string :kind

      t.timestamps
    end
    add_index :coupons, :user_id
  end
end
